import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/ruoyi";

// 查询住户列表
export function listHousehold(query) {
  return request({
    url: '/info/household/list',
    method: 'get',
    params: query
  })
}

// 查询楼栋管理列表
export function listBuilding(query) {
  return request({
    url: '/info/building/list',
    method: 'get',
    params: query
  })
}

export function listVillage(query) {
  return request({
    url: '/info/village/list',
    method: 'get',
    params: query
  })
}

// 查询住户详细
export function getHousehold(id) {
  return request({
    url: '/info/household/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增住户
export function addHousehold(data) {
  return request({
    url: '/info/household',
    method: 'post',
    data: data
  })
}

// 修改住户
export function updateHousehold(data) {
  return request({
    url: '/info/household',
    method: 'put',
    data: data
  })
}

// 删除住户
export function delHousehold(id) {
  return request({
    url: '/info/household/' + id,
    method: 'delete'
  })
}

//查询小区树
export function villageTree() {
  return request({
    url: '/info/village/villageTree',
    method: 'get'
  })
}
